package com.pmcc.core.repository;

import com.pmcc.core.entity.security.Role;
import com.pmcc.core.enums.RoleType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * Created by syk on 17/7/6.
 */
public interface RoleRepository extends JpaRepository<Role,String> {

    Page<Role> findAll(Specification<Role> spec, Pageable pageable);

    Role findByType(RoleType type);

    Role findByCode(String code);
}
